<%@ tag language="java" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ attribute name="content" type="java.lang.String" required="true" description="消息内容"%>
<%@ attribute name="type" type="java.lang.String" description="消息类型：info、success、warning、error、loading"%>
<c:if test="${not empty content}">
	<c:set var="ctype" value="${fn:indexOf(content,'失败') eq -1?'success':'error'}"/>
	<script type="text/javascript">
	var messageStockInterval = null;
	var messageTimes = 0;
		function hiddenMessage() {
			var opacity = 1 - messageTimes*0.1;
			$("#messageBox").css("opacity",opacity);
			if(messageTimes == 10) {
				$("#messageBox").css("display","none");
				clearInterval(messageStockInterval);
			}
			messageTimes++;
		}
		messageStockInterval = setInterval("hiddenMessage()",200);
	</script>
	<script type="text/javascript">showTip("${content}");</script>
	<!-- 
	<a id="messageBox" data-role="button" onclick="hiddenMessage()" class="alert-${ctype}"  data-iconpos="left">${content}</a>
	 -->
</c:if>
